﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace JustTest.Models
{
    public class Test
    {
        public int Id { get; set; }
        [StringLength(100, ErrorMessage = "Test title must be 25 characters or less in length.")]
        [Required(ErrorMessage = "Test title is required.")]
        public string Title { get; set; }

        [StringLength(1000, ErrorMessage = "Test description must be 1000 characters or less in length.")]
        [Required(ErrorMessage = "Test description is required.")]
        public string Description { get; set; }
        public int MaxResult { get; set; }

        public int CategoryId { get; set; }
        public virtual Category Category { get; set; }
        public virtual ApplicationUser User { get; set; }
        public virtual ICollection<Question> Questions { get; set; }
        public TestStatus Status { get; set; }
        public DateTime ReleaseDate { get; set; }

        public Test()
        {
            this.Questions = new HashSet<Question>();
        }
    }
}